home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / userbox / publicdomain / vim-4.2 / src / configure.in < prev    next >
Text File  |  1996-05-29  |  16KB  |  492 lines

  1. dnl autoconf script for Vim on Unix
  2. dnl
  3. dnl Process this file with autoconf 2.4 to produce a configure script.
  4. dnl Gnu m4 1.3 or later is also required
  5. dnl
  6.  
  7. AC_INIT(vim.h)
  8. AC_CONFIG_HEADER(config.h)
  9. AC_DEFINE(UNIX)    dnl or do you think configure may run on a non-unix system?
  10. AC_PROG_MAKE_SET
  11.  
  12. dnl Checks for programs.
  13. AC_PROG_CC    dnl required by almost everything
  14. AC_PROG_CPP    dnl required by header file checks
  15. AC_ISC_POSIX    dnl required by AC_C_CROSS
  16. AC_C_CROSS    dnl required by AC_TRY_RUN
  17.  
  18. dnl Set default value for CFLAGS if none is defined or it's empty
  19. if test -z "$CFLAGS"; then
  20.   CFLAGS="-O"
  21.   test "$GCC" = yes && CFLAGS="-O2 -fno-strength-reduce"
  22. fi
  23.  
  24. dnl you might want to remove this, if it causes too much trouble. I like it:
  25. dnl -Wmissing-prototypes removed, old versions of GCC don't have it
  26. test "$GCC" = yes && CFLAGS="$CFLAGS -Wall -Wshadow"
  27.  
  28. dnl If configure things we are cross compiling, there is probably something
  29. dnl wrong with the CC or CFLAGS settings, give an understandable error message
  30. if test "$cross_compiling" = yes; then
  31.   AC_MSG_ERROR([cannot compile a simple program, check CC and CFLAGS])
  32. fi
  33.  
  34. dnl see if the compiler accepts "-Olimit 2000", needed for some systems
  35. dnl because Vim uses very big case statements.
  36. if test "$GCC" != yes; then
  37.   AC_MSG_CHECKING(if compiler accepts -Olimit)
  38.   save_cflags=$CFLAGS
  39.   CFLAGS="$CFLAGS -Olimit 2000"
  40.   AC_TRY_LINK(, ,
  41.     AC_MSG_RESULT(yes),
  42.     AC_MSG_RESULT(no); CFLAGS=$save_cflags)
  43. fi
  44.  
  45. dnl gcc-cpp has the wonderful -MM option to produce nicer dependencies
  46. test "$GCC" = yes && CPP_MM=M; AC_SUBST(CPP_MM)
  47.  
  48. if test -f ./toolcheck; then
  49. AC_CHECKING(for buggy tools)
  50. sh ./toolcheck 1>&AC_FD_MSG
  51. fi
  52.  
  53.  
  54. dnl Check user requested features
  55. test -z "$with_x" && with_x=yes
  56. test "${enable_gui-no}" != no && with_x=yes
  57. if test "$with_x" = no; then
  58.   AC_MSG_RESULT(defaulting to: don't HAVE_X11)
  59. else
  60.   dnl do this header check early, so that its failure can override user
  61.   dnl requests.
  62.  
  63.   AC_PATH_PROG(xmkmfpath, xmkmf)
  64.  
  65.   AC_PATH_XTRA
  66.  
  67.   dnl On my system the X include dir is found, but the lib dir not. This is a
  68.   dnl desparate try to fix this.
  69.  
  70.   if test -d "$x_includes" && test ! -d "$x_libraries"; then
  71.     x_libraries=`echo "$x_includes" | sed s/include/lib/`
  72.     AC_MSG_RESULT(Corrected X libraries to $x_libraries)
  73.     X_LIBS="$X_LIBS -L$x_libraries"
  74.     if test "`(uname) 2>/dev/null`" = SunOS &&
  75.           uname -r | grep '^5' >/dev/null; then
  76.       X_LIBS="$X_LIBS -R $x_libraries"
  77.     fi
  78.   fi
  79.  
  80.   if test -d "$x_libraries" && test ! -d "$x_includes"; then
  81.     x_includes=`echo "$x_libraries" | sed s/lib/include/`
  82.     AC_MSG_RESULT(Corrected X includes to $x_includes)
  83.     X_CFLAGS="$X_CFLAGS -I$x_includes"
  84.   fi
  85.  
  86.   dnl remove "-I/usr/include " from X_CFLAGS, should not be needed.
  87.   X_CFLAGS="`echo $X_CFLAGS\  | sed 's%-I/usr/include %%'`"
  88.  
  89.   dnl Check if the X11 header files are correctly installed. On some systems
  90.   dnl Xlib.h includes files that don't exist
  91.     AC_MSG_CHECKING(if X11 header files can be found)
  92.     cflags_save=$CFLAGS
  93.     CFLAGS="$CFLAGS $X_CFLAGS"
  94.     AC_TRY_COMPILE([#include <X11/Xlib.h>], ,
  95.       AC_MSG_RESULT(yes),
  96.       AC_MSG_RESULT(no); no_x=yes)
  97.     CFLAGS=$cflags_save
  98.  
  99.   if test "${no_x-no}" = yes; then with_x=no; else 
  100.     AC_DEFINE(HAVE_X11) 
  101.     X_LIB=-lX11; AC_SUBST(X_LIB)
  102.   fi
  103.  
  104.   dnl Some systems need -lnsl -lsocket when testing for ICE.
  105.   dnl The check above doesn't do this, try here (again) if X_PRE_LIBS is empty
  106.   dnl and X_EXTRA_LIBS is not empty.  Check for other function then above to
  107.   dnl avoid the cached value
  108.  
  109.   if test -z "$X_PRE_LIBS" -a -n "$X_EXTRA_LIBS"; then
  110.     ac_save_LDFLAGS="$LDFLAGS"
  111.     LDFLAGS="$LDFLAGS -L$x_libraries"
  112.     AC_CHECK_LIB(ICE, IceOpenConnection,
  113.       [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"],, [$X_EXTRA_LIBS])
  114.     LDFLAGS="$ac_save_LDFLAGS"
  115.   fi
  116.  
  117. fi
  118.  
  119. test "x$with_x" = xno -a "x$enable_gui" = xyes && enable_gui=no
  120.  
  121. AC_ARG_ENABLE(gui, 
  122.  [  --enable-gui            X11-Athena or Motif Graphical User Interface],
  123.  AC_MSG_RESULT(option GUI: $enableval), 
  124.  AC_MSG_RESULT(defaulting to: don't support GUI))
  125.  MOTIF_COMMENT=ZZZ; ATHENA_COMMENT=ZZZ
  126.  case "$enable_gui" in
  127.    no | "" )        ;;
  128.    yes|YES)         MOTIF_COMMENT= ; ATHENA_COMMENT= ;;
  129.    motif|MOTIF)     MOTIF_COMMENT= ;;
  130.    athena|ATHENA)   ATHENA_COMMENT= ;;
  131.    *)               AC_MSG_ERROR([Sorry, $enable_gui GUI is not supported.]) ;;
  132.  esac
  133.  
  134. dnl Check for Motif include files location.
  135. dnl The LAST one found is used, this makes the highest version to be used,
  136. dnl e.g. when Motif1.2 and Motif2.0 are both present.
  137.  
  138. if test -z "$MOTIF_COMMENT"; then
  139.   gui_includes="`echo $x_includes|sed 's%/[^/][^/]*$%%'` /local/Motif*/include /local/include/Motif* /usr/local/Motif*/include /usr/local/include/Motif* /usr/include/Motif* /usr/Motif*/include /usr/local/include /usr/local/X11*/include /usr/include /usr/include/X11* /usr/dt/include $GUI_INC_LOC"
  140.   AC_MSG_CHECKING(for location of Motif GUI includes)
  141.   GUI_INC_LOC=
  142.   for try in $gui_includes; do
  143.     if test -f "$try/Xm/Xm.h"; then
  144.       GUI_INC_LOC=$try
  145.     fi
  146.   done
  147.   if test -n "$GUI_INC_LOC"; then
  148.     AC_MSG_RESULT($GUI_INC_LOC)
  149.     test "$GUI_INC_LOC" = /usr/include && GUI_INC_LOC=.
  150.     AC_SUBST(GUI_INC_LOC)
  151.   else
  152.     AC_MSG_RESULT(<not found>) 
  153.     MOTIF_COMMENT=ZZZ  
  154.   fi
  155. fi
  156.  
  157. dnl Check for Motif library files location.
  158. dnl The LAST one found is used, this makes the highest version to be used,
  159. dnl e.g. when Motif1.2 and Motif2.0 are both present.
  160.  
  161. if test -z "$MOTIF_COMMENT"; then
  162.   gui_libs="`echo $x_libraries|sed 's%/[^/][^/]*$%%'` `echo "$GUI_INC_LOC" | sed s/include/lib/` /local/Motif*/lib /local/lib/Motif* /usr/local/Motif*/lib /usr/local/lib/Motif* /usr/Motif*/lib /usr/lib/Motif* /usr/local/lib /usr/local/X11*/lib /usr/lib /usr/lib/X11* /usr/dt/lib $GUI_LIB_LOC"
  163.   AC_MSG_CHECKING(for location of Motif GUI libs)
  164.   GUI_LIB_LOC=
  165.   for try in $gui_libs; do
  166.     if test -f "$try/libXm.a" -o -f "$try/libXm.so" -o -f "$try/libXm.sl"; then
  167.       GUI_LIB_LOC=$try
  168.       if test "`(uname) 2>/dev/null`" = SunOS &&
  169.             uname -r | grep '^5' >/dev/null; then
  170.         GUI_LIB_LOC="$GUI_LIB_LOC -R $try"
  171.       fi
  172.     fi
  173.   done
  174.   if test -n "$GUI_LIB_LOC"; then
  175.     AC_MSG_RESULT($GUI_LIB_LOC)
  176.     AC_SUBST(GUI_LIB_LOC)
  177.   else
  178.     AC_MSG_RESULT(<not found>) 
  179.     MOTIF_COMMENT=ZZZ  
  180.   fi
  181. fi
  182.  
  183. if test -z "$MOTIF_COMMENT"; then
  184.   ATHENA_COMMENT=ZZZ
  185. fi
  186. AC_SUBST(MOTIF_COMMENT)
  187.  
  188. dnl Check if the Athena files can be found
  189.  
  190. GUI_X_LIBS=
  191.  
  192. if test -z "$ATHENA_COMMENT"; then
  193.   AC_MSG_CHECKING(if Athena header files can be found)
  194.   cflags_save=$CFLAGS
  195.   CFLAGS="$CFLAGS $X_CFLAGS"
  196.   AC_TRY_COMPILE([
  197. #include <X11/Intrinsic.h>
  198. #include <X11/Xaw/Paned.h>], ,
  199.     AC_MSG_RESULT(yes),
  200.     AC_MSG_RESULT(no); ATHENA_COMMENT=ZZZ )
  201.   CFLAGS=$cflags_save
  202. fi
  203.  
  204. if test -z "$ATHENA_COMMENT"; then
  205.   dnl The GUI_INC_LOC and GUI_LIB_LOC must not be empty, use "." (ugly!)
  206.   if test -z "$GUI_INC_LOC"; then
  207.     GUI_INC_LOC=.
  208.   fi
  209.   AC_SUBST(GUI_INC_LOC)
  210.   if test -z "$GUI_LIB_LOC"; then
  211.     GUI_LIB_LOC=.
  212.   fi
  213.   AC_SUBST(GUI_LIB_LOC)
  214. fi
  215.  
  216. if test -z "$ATHENA_COMMENT" -o -z "$MOTIF_COMMENT"; then
  217.   dnl Check for -lXext, needed on some systems
  218.   ldflags_save=$LDFLAGS
  219.   LDFLAGS="$LDFLAGS $X_LIBS"
  220.   AC_CHECK_LIB(Xext, XShapeQueryExtension, GUI_X_LIBS="-lXext",, -lX11 $X_EXTRA_LIBS)
  221.   LDFLAGS=$ldflags_save
  222.  
  223.   dnl Execute xmkmf to figure out if -DNARROWPROTO is needed.
  224.   AC_MSG_CHECKING(for extra X11 defines)
  225.   NARROW_PROTO=
  226.   rm -fr conftestdir
  227.   if mkdir conftestdir; then
  228.     cd conftestdir
  229.     cat > Imakefile <<'EOF'
  230. acfindx:
  231.     @echo 'NARROW_PROTO="${PROTO_DEFINES}"'
  232. EOF
  233.     if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
  234.       eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
  235.     fi
  236.     cd ..
  237.     rm -fr conftestdir
  238.   fi
  239.   if test -z "$NARROW_PROTO"; then
  240.     AC_MSG_RESULT(no)
  241.   else
  242.     AC_MSG_RESULT($NARROW_PROTO)
  243.   fi
  244.   AC_SUBST(NARROW_PROTO)
  245. fi
  246.  
  247. AC_SUBST(ATHENA_COMMENT)
  248. AC_SUBST(GUI_X_LIBS)
  249.  
  250. dnl Checks for libraries.
  251. AC_MSG_CHECKING(for sequent/ptx)
  252. AC_EGREP_CPP(yes,
  253. [#ifdef _SEQUENT_
  254.   yes;
  255. #endif
  256. ], LIBS="$LIBS -linet" AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
  257.  
  258. olibs="$LIBS"
  259. if test -n "$TERM_LIB"; then
  260.     LIBS="$LIBS $TERM_LIB"
  261. else
  262.     dnl  On HP-UX 10.10 termcap or termlib should be used instead of
  263.     dnl  curses, because curses is much slower.
  264.     dnl  Older versions of ncurses have bugs, avoid it.
  265.     AC_CHECK_LIB(termcap, tgetent,,
  266.     AC_CHECK_LIB(termlib, tgetent,,
  267.     AC_CHECK_LIB(curses, tgetent,,
  268.     AC_CHECK_LIB(ncurses, tgetent,,
  269.     ))))
  270. fi
  271. if test "x$olibs" != "x$LIBS"; then
  272.   AC_MSG_CHECKING(whether we talk terminfo)
  273.   AC_TRY_RUN([main() { exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); }],
  274.       AC_MSG_RESULT([no -- we are in termcap land]),
  275.       AC_MSG_RESULT([yes -- terminfo spoken here]); AC_DEFINE(TERMINFO),
  276.       AC_MSG_ERROR(failed to compile test program.))
  277. fi
  278.  
  279. AC_MSG_CHECKING(quality of toupper)
  280. AC_TRY_RUN([#include <ctype.h>
  281. main() { exit(toupper('A') == 'A' && tolower('z') == 'z'); }], 
  282.  AC_DEFINE(BROKEN_TOUPPER) AC_MSG_RESULT(bad),
  283.  AC_MSG_RESULT(good), AC_MSG_ERROR(failed to compile test program))
  284.  
  285. AC_MSG_CHECKING(whether __DATE__ and __TIME__ work)
  286. AC_TRY_COMPILE(, [fprintf("(" __DATE__ " " __TIME__ ")");],
  287.     AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME),
  288.     AC_MSG_RESULT(no))
  289.  
  290. dnl Checks for header files.
  291. AC_CHECK_HEADER(elf.h, SVR4=1)
  292. dnl AC_CHECK_HEADER(dwarf.h, SVR4=1)
  293. if test "$SVR4" = 1; then AC_DEFINE(SVR4) AC_CHECK_LIB(elf, main) fi
  294.  
  295. AC_HEADER_DIRENT
  296.  
  297. dnl check for standard headers, we don't use this in Vim but other stuff
  298. dnl in autoconf needs it
  299. AC_HEADER_STDC
  300. AC_HEADER_SYS_WAIT
  301.  
  302. dnl If sys/wait.h is not found it might still exist but not be POSIX
  303. dnl compliant. In that case we define HAVE_UNION_WAIT (for NeXT)
  304. if test $ac_cv_header_sys_wait_h = no; then
  305.    AC_MSG_CHECKING([for sys/wait.h that defines union wait])
  306.    AC_TRY_COMPILE([#include <sys/wait.h>],
  307.             [union wait xx, yy; xx = yy],
  308.         AC_MSG_RESULT(yes)
  309.             AC_DEFINE(HAVE_SYS_WAIT_H)
  310.             AC_DEFINE(HAVE_UNION_WAIT),
  311.         AC_MSG_RESULT(no))
  312. fi
  313.  
  314. AC_CHECK_HEADERS(stdlib.h string.h sys/select.h sys/utsname.h termcap.h)
  315. AC_CHECK_HEADERS(fcntl.h sgtty.h sys/ioctl.h sys/time.h termio.h)
  316. AC_CHECK_HEADERS(unistd.h stropts.h errno.h strings.h sys/systeminfo.h locale.h)
  317. AC_CHECK_HEADERS(sys/stream.h sys/ptem.h termios.h libc.h sys/statfs.h)
  318. AC_CHECK_HEADERS(sys/poll.h pwd.h)
  319.  
  320. dnl Checks for typedefs, structures, and compiler characteristics.
  321. AC_C_CONST
  322. AC_TYPE_MODE_T
  323. AC_TYPE_OFF_T
  324. AC_TYPE_PID_T
  325. AC_TYPE_SIZE_T
  326. AC_TYPE_UID_T
  327. AC_HEADER_TIME
  328.  
  329. AC_MSG_CHECKING(whether termcap.h contains ospeed)
  330. AC_TRY_LINK([
  331. #ifdef HAVE_TERMCAP_H
  332. # include <termcap.h>
  333. #endif
  334.             ], [ospeed = 20000],
  335.     AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OSPEED),
  336.     [AC_MSG_RESULT(no)
  337.     AC_MSG_CHECKING(whether ospeed can be extern)
  338.     AC_TRY_LINK([
  339. #ifdef HAVE_TERMCAP_H
  340. # include <termcap.h>
  341. #endif
  342. extern short ospeed;
  343.             ], [ospeed = 20000],
  344.         AC_MSG_RESULT(yes); AC_DEFINE(OSPEED_EXTERN),
  345.         AC_MSG_RESULT(no))]
  346.     )
  347.  
  348. AC_MSG_CHECKING([whether termcap.h contains UP, BC and PC])
  349. AC_TRY_LINK([
  350. #ifdef HAVE_TERMCAP_H
  351. # include <termcap.h>
  352. #endif
  353.             ], [if (UP == 0 && BC == 0) PC = 1],
  354.     AC_MSG_RESULT(yes); AC_DEFINE(HAVE_UP_BC_PC),
  355.     [AC_MSG_RESULT(no)
  356.     AC_MSG_CHECKING([whether UP, BC and PC can be extern])
  357.     AC_TRY_LINK([
  358. #ifdef HAVE_TERMCAP_H
  359. # include <termcap.h>
  360. #endif
  361. extern char *UP, *BC, PC;
  362.             ], [if (UP == 0 && BC == 0) PC = 1],
  363.         AC_MSG_RESULT(yes); AC_DEFINE(UP_BC_PC_EXTERN),
  364.         AC_MSG_RESULT(no))]
  365.     )
  366.  
  367. AC_MSG_CHECKING(whether tputs() uses outfuntype)
  368. AC_TRY_COMPILE([
  369. #ifdef HAVE_TERMCAP_H
  370. # include <termcap.h>
  371. #endif
  372.             ], [extern int xx(); tputs("test", 1, (outfuntype)xx)],
  373.     AC_MSG_RESULT(yes); AC_DEFINE(HAVE_OUTFUNTYPE),
  374.     AC_MSG_RESULT(no))
  375.  
  376. dnl On some SCO machines sys/select redefines struct timeval
  377. AC_MSG_CHECKING([whether sys/select.h and sys/time.h may both be included])
  378. AC_TRY_COMPILE([
  379. #include <sys/types.h>
  380. #include <sys/time.h>
  381. #include <sys/select.h>], ,
  382.       AC_MSG_RESULT(yes)
  383.             AC_DEFINE(SYS_SELECT_WITH_SYS_TIME),
  384.       AC_MSG_RESULT(no))
  385.  
  386. dnl AC_DECL_SYS_SIGLIST
  387.  
  388. dnl Checks for library functions. ===================================
  389. AC_PROG_GCC_TRADITIONAL
  390. AC_TYPE_SIGNAL
  391.  
  392. dnl find out what to use at the end of a signal function
  393. if test $ac_cv_type_signal = void; then
  394.    AC_DEFINE(SIGRETURN, [return])
  395. else
  396.    AC_DEFINE(SIGRETURN, [return 0])
  397. fi
  398.  
  399. dnl tricky stuff: try to find out if getcwd() is implemented with
  400. dnl system("sh -c pwd")
  401. AC_MSG_CHECKING(getcwd implementation)
  402. AC_TRY_RUN([
  403. char *dagger[] = { "IFS=pwd", 0 };
  404. main()
  405. {
  406.   char buffer[500];
  407.   extern char **environ;
  408.   environ = dagger;
  409.   return getcwd(buffer, 500) ? 0 : 1;
  410. }],
  411.     AC_MSG_RESULT(it is usable),
  412.     AC_MSG_RESULT(it stinks)
  413.         AC_DEFINE(BAD_GETCWD),
  414.     AC_MSG_ERROR(failed to compile test program))
  415.  
  416. AC_CHECK_FUNCS(sigset getcwd getwd select strcspn strtol killpg)
  417. AC_CHECK_FUNCS(tgetent memset strerror fchown fsync fchdir)
  418. AC_CHECK_FUNCS(setenv putenv gettimeofday getpwuid getpwnam qsort)
  419.  
  420. dnl rename needs to be checked separately to work on Nextstep with cc
  421. AC_MSG_CHECKING(for rename)
  422. AC_TRY_LINK([#include <stdio.h>], [rename("this", "that")],
  423.     AC_MSG_RESULT(yes); AC_DEFINE(HAVE_RENAME),
  424.     AC_MSG_RESULT(no))
  425.  
  426. dnl this generates a warning, because the macro from autoconf is wrong.
  427. dnl just ignore it.
  428. AC_CHECK_SIZEOF(int)
  429.  
  430. AC_MSG_CHECKING(whether memmove/bcopy/memcpy handle overlaps)
  431. [bcopy_test_prog='
  432. main() {
  433.   char buf[10];
  434.   strcpy(buf, "abcdefghi");
  435.   bcopy(buf, buf + 2, 3);
  436.   if (strncmp(buf, "ababcf", 6))
  437.     exit(1);
  438.   strcpy(buf, "abcdefghi");
  439.   bcopy(buf + 2, buf, 3);
  440.   if (strncmp(buf, "cdedef", 6))
  441.     exit(1);
  442.   exit(0); /* libc version works properly.  */
  443. }']
  444.  
  445. dnl Check for memmove() before bcopy(), makes memmove() be used when both are
  446. dnl present, fixes problem with incompatibility between Solaris 2.4 and 2.5.
  447.  
  448. AC_TRY_RUN([#define bcopy(s,d,l) memmove(d,s,l) $bcopy_test_prog],
  449.  AC_DEFINE(USEMEMMOVE) AC_MSG_RESULT(memmove does),
  450. AC_TRY_RUN([$bcopy_test_prog],
  451.  AC_DEFINE(USEBCOPY) AC_MSG_RESULT(bcopy does),
  452. AC_TRY_RUN([#define bcopy(s,d,l) memcpy(d,s,l)  $bcopy_test_prog],
  453.  AC_DEFINE(USEMEMCPY) AC_MSG_RESULT(memcpy does), AC_MSG_RESULT(no),
  454.   AC_MSG_ERROR(failed to compile test program)),
  455.   AC_MSG_ERROR(failed to compile test program)), 
  456.   AC_MSG_ERROR(failed to compile test program)) 
  457.  
  458. dnl Check how we can run ctags
  459. dnl -t for typedefs (many ctags have this)
  460. dnl -s for static functions (Elvis ctags only?)
  461. dnl -v for variables. Dangerous, most ctags take this for 'vgrind style'.
  462. dnl -i+t to test for Darren Hiebert's ctags (no arguments really needed)
  463. AC_MSG_CHECKING(how to create tags)
  464. test -f tags && mv tags tags.save
  465. (eval etags       /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && CTAGS="etags"
  466. (eval etags -c    /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && CTAGS="etags -c"
  467. (eval ctags       /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && CTAGS="ctags"
  468. (eval ctags -t    /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && CTAGS="ctags -t"
  469. (eval ctags -ts   /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && CTAGS="ctags -ts"
  470. (eval ctags -tvs  /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && CTAGS="ctags -tvs"
  471. (eval ctags -i+t  /dev/null) < /dev/null 1>&AC_FD_CC 2>&1 && CTAGS="ctags -i+t"
  472. test -f tags.save && mv tags.save tags
  473. AC_MSG_RESULT($CTAGS) AC_SUBST(CTAGS)
  474.  
  475. dnl Check if PREFIX/share exists
  476. dnl unfortunately prefix may not be set here yet
  477. AC_MSG_CHECKING(for default location to put help files)
  478. if test "x$prefix" = xNONE; then
  479.    tt=$ac_default_prefix
  480. else
  481.    tt=$prefix
  482. fi
  483. if test -d "$tt""/share"; then
  484.    HELPDIR="/share"
  485. else
  486.    HELPDIR="/lib"
  487. fi
  488. AC_MSG_RESULT("$tt""$HELPDIR") AC_SUBST(HELPDIR)
  489.  
  490. dnl write output files
  491. AC_OUTPUT(config.mk)
  492.